package com.animal.controller;

import com.animal.pojo.ItemCat;
import com.animal.service.ItemCatService;
import com.animal.vo.EasyUITree;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ItemCatController {

    @Autowired
    private ItemCatService itemCatService;

    @RequestMapping("/itemCat/findItemCatById")
    public ItemCat findItemCatById(Long id){
        return itemCatService.findItemCatById(id);
    }

    @RequestMapping("/item/cat/list")
    public List<EasyUITree> findItemCatList(Long id){
        long parentId=(id==null?0:id);
        return itemCatService.findItemCatList(parentId);
    }
}
